#pragma once

#include <nlohmann/json.hpp>


using nlohmann::json;


namespace rviz_custom_plugins 
{


namespace models 
{


class MissionConfig
{

public:

    std::string folder = "mission";
    std::string waypointsFile = "way_point.json";
    std::string safeAreasFile = "safe_area.json";
    std::string limitAreasFile = "limit_area.json";
    std::string photoPointsFile = "photo_point.json";
    std::string photoPlanesFile = "photo_plane.json";

};


inline void to_json(json& j, const MissionConfig& config) {
    
    j = json{
        {"folder", config.folder},
        {"waypointsFile", config.waypointsFile},
        {"safeAreasFile", config.safeAreasFile},
        {"limitAreasFile", config.limitAreasFile},
        {"photoPointsFile", config.photoPointsFile},
        {"photoPlanesFile", config.photoPlanesFile}
    };
}


inline void from_json(const json& j, MissionConfig& config)
{
    config.folder = j.value("folder", config.folder);
    config.waypointsFile = j.value("waypointsFile", config.waypointsFile);
    config.safeAreasFile = j.value("safeAreasFile", config.safeAreasFile);
    config.limitAreasFile = j.value("limitAreasFile", config.limitAreasFile);
    config.photoPointsFile = j.value("photoPointsFile", config.photoPointsFile);
    config.photoPlanesFile = j.value("photoPlanesFile", config.photoPlanesFile);
}




}


}